Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented an --ignore-file option to lint/report commands to ignore specific errors #515

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

lobocv
Copy link

@lobocv lobocv commented Jul 2, 2024

The ignore-file is a YAML file that lists the paths for each rule for which to ignore errors for.
It can be used when introducing new linting rules which require breaking changes to existing production APIs.

In the example below, say I want to add a lint rule that new URLs must have a version in the path. This would break existing URLs which do not have versions in their path. We can use the ignorefile to grandfather those APIs while enforcing new APIs start using versioning.

Example ignorefile.yml using the burgershop API in the tests:

url-starts-with-major-version:
  - $.paths['/burgers']
  - $.paths['/burgers/{burgerId}']
  - $.paths['/burgers/{burgerId}/dressings']
  - $.paths['/dressings/{dressingId}']
  - $.paths['/dressings']

@lobocv lobocv changed the title Implemented an ignore-file option to lint/report commands to ignore specific errors Implemented an --ignore-file option to lint/report commands to ignore specific errors Jul 2, 2024
…s a YAML file that lists the paths for each rule for which to ignore errors for.
Copy link
Owner

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I really like this implementation. It keeps the spec free of custom extensions, and allows per path configuration.

@daveshanley
Copy link
Owner

I want to upgrade libopenapi and other core components, so the next release will be a minor one. Would you mind adding some content to the readme about using this? I can then use it for the main docs.

@daveshanley daveshanley merged commit 6041a74 into daveshanley:main Jul 8, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants